# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=ruby-unicode-confusable
_gemname=${pkgname#ruby-}
pkgver=1.12.0
pkgrel=2
pkgdesc='Unicode confusables helper in Ruby.'
arch=('any')
url='https://github.com/janlelis/unicode-confusable'
license=('MIT')
depends=('ruby')
source=("https://rubygems.org/downloads/$_gemname-$pkgver.gem")
noextract=("$_gemname-$pkgver.gem")
sha512sums=('6b4ddc7225cf3530a9cf529c926c8c6ab7c64a6f40b0dc07d56eb163bc0cafb997679888e6ef22d981ae3423c31350f7b4266f4ae487929f16d8c697e233dda2')

package() {
  _gemhome="$(gem env home)"

  gem install --ignore-dependencies --no-user-install --no-document \
    -i "$pkgdir/$_gemhome" -n "$pkgdir/usr/bin" "$_gemname-$pkgver.gem"

  rm "$pkgdir/$_gemhome/cache/$_gemname-$pkgver.gem"

  install -Dm 644 "$pkgdir/$_gemhome/gems/$_gemname-$pkgver/MIT-LICENSE.txt" \
    "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

